package com.product.system.aop;
import cn.hutool.json.JSONUtil;
import com.product.system.service.SysRoleLogService;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

@Aspect
@Component
public class MyAop {



    @Autowired
    SysRoleLogService sysRoleLogService;



    @Around("execution(* com.product.system.controller.SysDictDataController.*(..))")
    public Object roleAddLog(ProceedingJoinPoint joinPoint) throws Throwable {


        Object proceed = joinPoint.proceed();

        Object[] args = joinPoint.getArgs();
        System.out.println(JSONUtil.toJsonStr(args));

        LocalDateTime now = LocalDateTime.now();
        System.out.println(now);

        return proceed;

    }

}
